<template>
  <div id="tixianGroup">

    <div class="flex_head">
      <div class="solid"></div>
      <h3 class="item_two">提现的商务组列表</h3>
      <div >
        <el-button type="primary" @click="goBack()">返回通道</el-button>
      </div>
    </div>

    <el-row>
      <el-table border :data="tableData" style="width: 100%" v-loading="loading">
        <el-table-column prop="id" label="ID" width="80">
        </el-table-column>
        <el-table-column prop="name" label="商户组名" >
        </el-table-column>


        <el-table-column label="商户管理">
          <template slot-scope="scope">
            <el-button type="text" size='mini' @click="goRequireList(scope.row)">商户管理</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="block" style="text-align: right;padding-right: 40px;">

        <el-pagination :current-page.sync="pageNumber" @current-change='handleChange' :page="pageNumber"
                       :page-size="pageSize" layout="total, prev, pager, next" :total="total">
        </el-pagination>
      </div>
    </el-row>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        tableData: [],
        loading: false,
        pageSize: 10,
        pageNumber: 1,
        total: 1
      }
    },
    created() {
      this.getGroupList()
    },
    methods: {
      getGroupList() {
        this.loading = true
        let params = {
          pageSize: this.pageSize,
          pageNumber: this.pageNumber
        }
        this.$api.getTixianGroupList(this.$route.query.id, params).then(res => {
          if (res.code == '000000') {
            this.loading = false
            this.tableData = res.data.list;
            this.total = res.data.totalRow;
            this.$message.success('获取商户组列表成功')

          }
        })
      },
      goRequireList(row) {
        this.$router.push({
          path: '/tixian/business',
          query: {
            name: row.name,
            id: row.id
          }
        })
      },
      goBack() {
        this.$router.go(-1)
      },
      handleChange(val) {
        this.pageNumber = val;
        this.getGroupList()
      }
    }


  }
</script>

<style lang="less">
  #tixianGroup {
    th {
      text-align: center;
    }
  }
</style>
